Prevent panic on git blame by limiting lines to 4096 bytes at most#13470
Merged
techknowlogick merged 3 commits intoNov 10, 2020
Merged
Conversation
Fix go-gitea#12440 Closes go-gitea#13192 Signed-off-by: Andrew Thornton <art27@cantab.net>
Contributor
Author
|
There is a potentially nicer solution here - limit the lines to 1024 or possibly a fewer number of runes and create an expansion button. However this PR presents the simplest fix to prevent the panic. |
mrsdizzie
approved these changes
Nov 9, 2020
6543
approved these changes
Nov 9, 2020
Member
|
works nicely |
Member
|
🚀 |
Codecov Report
@@ Coverage Diff @@
## master #13470 +/- ##
==========================================
+ Coverage 42.05% 42.19% +0.13%
==========================================
Files 694 694
Lines 76334 76347 +13
==========================================
+ Hits 32105 32212 +107
+ Misses 38971 38857 -114
- Partials 5258 5278 +20
Continue to review full report at Codecov.
|
Member
|
🚀 |
techknowlogick
added a commit
to techknowlogick/gitea
that referenced
this pull request
Nov 10, 2020
…o-gitea#13470) Fix go-gitea#12440 Closes go-gitea#13192 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
techknowlogick
added a commit
to techknowlogick/gitea
that referenced
this pull request
Nov 10, 2020
…o-gitea#13470) Fix go-gitea#12440 Closes go-gitea#13192 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR prevents the panic by limiting the number of bytes per line to 4096 bytes (The default buffer size for a reader)
Fix #12440
Closes #13192
Signed-off-by: Andrew Thornton art27@cantab.net